home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2542 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: info.spt.net.cn!usenet
  2. From: Xu Yifeng <jafd@public.sta.net.cn>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: [Q] same template name with template-arg-list
  5. Date: Mon, 15 Jan 1996 10:44:15 -0800
  6. Organization: ZheJiang Securities Co.Ltd
  7. Message-ID: <30FAA07F.5396@public.sta.net.cn>
  8. References: <whlong48ht.fsf@balder.metis.no>
  9. NNTP-Posting-Host: ts1-20.sta.net.cn
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b5 (Win16; I)
  14.  
  15. Steinar Bang wrote:
  16. |> 
  17. |> Is it legal in the ANSI C++ draft to have something like:
  18. |> 
  19. |> template<class T> class sequence {
  20. |> public:
  21. |>   sequence() ;
  22. |> };
  23. |> 
  24. |> template<class T, int len> class sequence {
  25. |> public:
  26. |>   sequence() ;
  27. |> };
  28. |> 
  29. |> and have these two be different templates?
  30. |> 
  31. |> Same template name but different argument lists should give different
  32. |> signatures, so I don't see any principal problem...?
  33. |> 
  34. |> Thanx!
  35. |> 
  36. |> - Steinar
  37.  
  38.  
  39. Hi,
  40.  
  41. I think you want to write two different templates,, it can not be compiled 
  42. because naming conclusion, this because the signature in argument list 
  43. is implied and not belong to the C++ naming space, the signatures will
  44. not be put into the class name, C++ doesn't support class overload!
  45.  
  46. Best wishs,
  47. Xu Yifeng
  48.